<?php require('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"EX-2-1");
mysql_select_db($database_con_gl, $con_gl);
$query_klas = "SELECT id, nama FROM gl_kontak ORDER BY nama ASC";
$klas = mysql_query($query_klas, $con_gl) or die(mysql_error());
$row_klas = mysql_fetch_assoc($klas);
$totalRows_klas = mysql_num_rows($klas);
?>
<link type="text/css" rel="stylesheet" href="css/jquery.wysiwyg.css" />
<script type="text/javascript" src="js/jquery.wysiwyg.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#add').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
$(function()
  {
	  $('#keterangan').wysiwyg();
  });
</script>
<script>
function sendRespondCabang() {
	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('divJenis');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
		if (ajaxRequest.readyState == 3) {
			var ajaxDisplay = document.getElementById('divJenis');
			ajaxDisplay.innerHTML = "<img src='images/ajax-loader.gif' />";
		}
	}
	ajaxRequest.open("GET", "include/send_respondcabang.php", true);
	ajaxRequest.send(null);	
}
</script>

<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Tambah Asuransi Rekanan </h1>
<form action="proses/asuransirekanan.php?act=add" method="POST" name="add" id="add" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
    <tr valign="top">
      <td width="20%" align="right" bgcolor="#FFFFFF">Nama Perusahaan* : </td>
      <td width="80%" bgcolor="#FFFFFF"><label>
        <input name="nama" type="text" id="nama" size="30" maxlength="100" />
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">NPWP : </td>
      <td bgcolor="#FFFFFF"><input name="npwp" type="text" id="npwp" size="30" maxlength="100" /></td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Alamat : </td>
      <td bgcolor="#FFFFFF"><label>
        <textarea name="alamat" cols="85" rows="5" id="alamat"></textarea>
        <input name="id" type="hidden" id="id" />
      </label></td>
    </tr>
    <tr>
      <td align="left" bgcolor="#FFFFFF"><div align="right">No. Telpon : </div></td>
      <td bgcolor="#FFFFFF"><input name="tlp" type="text" id="tlp" size="30" maxlength="100" /></td>
    </tr>
    <tr>
      <td align="left" bgcolor="#FFFFFF"><div align="right">email : </div></td>
      <td bgcolor="#FFFFFF"><input name="email" type="text" id="email" size="18" maxlength="100" />
        <input name="id2" type="hidden" id="id2" />
Format : abc@xx.com</td>
    </tr>
    <tr>
    <td align="left"><label><em>*Harus diisi
          <input name="open" type="hidden" id="open" value="<?php echo $_GET['open'];?>" />
    </em></label></td>
      <td bgcolor="#FFFFFF"><label>
        <input name="Save" type="submit" id="Save" value="Simpan" />
        </label>
          <label>
          <input type="button" name="Button" value="Batal" onclick="javascript:<?php if($_GET['open']=='window') { ?>window.close(2000);<?php }else{ ?>history.go(-1);<?php } ?>" />
        </label></td>
    </tr>
  </table>
</form>
